﻿using System.Diagnostics;

namespace advanceddirectiongame
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();
            int errornum = 0;
            for (int i = 0; i < 10; i++)//设置游戏次数是10次
            {
                int m;
                Random rd = new Random();
                m = rd.Next(65, 123);
                char c = (char)m;
                Console.Write(c);
                Console.WriteLine($"   目前错误次数:{errornum}");
                char input = Console.ReadKey(true).KeyChar;
                if (input != c) errornum++;
                Console.Clear();
            }
            Console.WriteLine($"您的错误次数是：{errornum}次");//显示最终错误次数
            sw.Stop();
            TimeSpan ts2 = sw.Elapsed;
            Console.WriteLine("本程序总共花费{0}ms.", ts2.TotalMilliseconds);//统计程序执行时间
        }
    }
}